from sqlalchemy import Column,Table,CHAR,ForeignKey
from sqlalchemy.sql.expression import null
from ..data import meta
from pydantic import BaseModel

N_information_table=Table(
    'N_information',meta,
    Column(
        'N_ID',CHAR(60),
        primary_key=True,
        nullable=False,
        unique=True,
    ),
    Column(
        'N_title',CHAR(60),
        nullable=False,
    ),
    Column(
        'write_H_ID',CHAR(60),
        ForeignKey('dorm_administrator.dorm_administrator_id'),
        nullable=False,
    ),
    Column(
        'write_H_name',CHAR(60),
        nullable=False,
    ),
    Column(
        'seeing_B_ID',CHAR(60),
        ForeignKey('building.building_id'),
        nullable=False,
    ),
    Column(
        'content',CHAR(60),
        nullable=False,
    ),
    Column(
        'publish_time',CHAR(60),
        nullable=False,
    )
)

class NoticeInDB(BaseModel):
    N_ID:str
    N_title:str
    write_H_ID:str
    write_H_name:str
    seeing_B_ID:str
    content:str
    publish_time:str